package com.zwps.biz.controller.http;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.zwps.biz.dal.db.object.PubCommonFileDO;
import com.zwps.biz.dal.db.object.PubDutyThreeDO;
import com.zwps.biz.domain.service.PubCommonFileService;
import com.zwps.biz.domain.service.PubDutyThreeService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Tag(name = "四制（治）")
@RestController
@RequestMapping("brief/responsibility")
@Validated
public class PubDutyThreeController {
    @Autowired
    private PubDutyThreeService threeService;

    @Operation(summary = "查询责任人")
    @GetMapping("getList")
    public List<PubDutyThreeDO> getList(@RequestParam(value = "type", required = false) Integer type) {
        return threeService.list(new LambdaQueryWrapper<PubDutyThreeDO>()
                .eq(type != null, PubDutyThreeDO::getType, type)
                .eq(PubDutyThreeDO::getIsDelete,0)
        );
    }
}
